var inputName = document.getElementById("name");
var inputPassword = document.getElementById("ciphertext");
function add() {
    inputPassword.value = inputName.value.split("").reverse().join("");
    console.log(inputName.value);
    console.log(inputPassword.value)
}
class Obj {
    set txt(value) {    //通过setter设置txt方法
        inputName.innerText = value;
    }
}
let watcher = new Obj();    //创建一个实例，赋值给watcher
inputName.oninput = function () {
    watcher.txt = this.value;
    console.log(watcher)
}

let a=new Obj()
console.log(a)

